package butines.game;
import java.util.LinkedList;
import java.util.List;


public class CooldownSet {

	private List<Cooldown> cooldownSet = new LinkedList<Cooldown>();
	
	public void add(Cooldown cooldown) {
		if (cooldown == null) {
			return;
		}
		if (cooldownSet.contains(cooldown)) {
			return;
		}
		cooldownSet.add(cooldown);
	}
	
	public void remove(Cooldown cooldown) {
		if (cooldown == null) {
			return;
		}
		cooldownSet.remove(cooldown);
	}
	
	public void update(float dt) {
		for (Cooldown cooldown: cooldownSet) {
			cooldown.update(dt);
		}
	}
	
	public Cooldown createCooldown(float waitTime) {
		Cooldown cooldown = new Cooldown(waitTime);
		add(cooldown);
		return cooldown;
	}
	
}
